<?
session_start();
require_once('Local_Settings.php');
require_once('../cart/inc/functions/Cart_Functions.php');
if (!(isset($_SESSION['myusername']) && $_SESSION['mypassword'] != '')) {
header ("Location: http://www.group3productions.info/admin/main_login.php");
}
include 'config.php';
$name=$_SESSION['myusername'];
$result = mysql_query("SELECT admin FROM klant WHERE email = '{$name}'");
if (!$result) {
    die("Query to show fields from table failed");
}
$row=mysql_fetch_array($result);
if($row['admin'] <> 1)
{
header ("Location: http://www.group3productions.info/index.php");
}

define('ga_email','g3pinf1b@gmail.com');
define('ga_password','group3FTW');
define('ga_profile_id','44033120');

require 'gapi.class.php';

$ga = new gapi(ga_email,ga_password);

$ga->requestReportData(ga_profile_id,array('browser','browserVersion'),array('pageviews','visits'));
?>

<!--Alhier het systeem voor het behoud van een layout op de hele website. Alle wijzigingen aan de layout dienen te gebeuren in de header,body en footer.php bestanden. Enkel de content mag in dit bestand staan.-->
<?php include('../style/header-1.php');//hieronder komt de linkerbalk met artikelen ?>
<? include('../menu.php'); ?>
<?php include('../style/body-2.php');//hieronder het midden van de pagina ?>

<table border="0" width="600"><tr><td width="444" align="center">

<h2>Site Statistieken</h2>

<table>
<tr>
  <th>Browser &amp; Versie</th>
  <th>Pageviews</th>
  <th>Bezoeken</th>
</tr>
<?php
foreach($ga->getResults() as $result):
?>
<tr>
  <td><?php echo $result ?></td>
  <td><?php echo $result->getPageviews() ?></td>
  <td><?php echo $result->getVisits() ?></td>
</tr>
<?php
endforeach
?>
</table>
</br></br>
<table>
<tr>
  <th>Totaal resultaten</th>
  <td><?php echo $ga->getTotalResults() ?></td>
</tr>
<tr>
  <th>Totaal pageviews</th>
  <td><?php echo $ga->getPageviews() ?>
</tr>
<tr>
  <th>Total bezoeken</th>
  <td><?php echo $ga->getVisits() ?></td>
</tr>
<tr>
  <th>&nbsp;</th>
  <td>&nbsp;</td>
</tr>
<tr>
  <th>Resultaten geupdate</th>
  <td><?php echo $ga->getUpdated() ?></td>
</tr>
</table>

</br></br>

<p>Klik <a href="https://www.google.com/accounts/ServiceLogin?service=analytics&passive=true&nui=1&hl=nl&continue=https://www.google.com/analytics/settings/&followup=https://www.google.com/analytics/settings/" target="_blank">hier</a> om de volledige gegevens te bekijken.</p>

</td></tr></table>

<?php include('../style/body-3.php');//hieronder de rechterbalk ?>
<? echo ( DisplayCartBald($Session_Prefix,$Currency_Symbol,$Currency_Code));?> 
<?php include('../style/footer-4.php');?>